package edu.umassd.visual.components;

import java.awt.Color;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import processing.core.PFont;
import edu.umassd.visual.Display;
import edu.umassd.visual.RADDACLDisplay;
import edu.umassd.visual.options.SelectFont;

@Component("zoom")
public class Zoom implements Displayable<RADDACLDisplay>
{
	private boolean visible = false;

	@Autowired
	private SelectFont selectedFont;

	@Override
	public void display(RADDACLDisplay display)
	{
		double value = display.getZoom();

		if (visible)
		{
			PFont font = selectedFont.getFont();

			display.fill(Color.WHITE);
			display.textFont(font);
			display.textAlign(Display.LEFT);
			display.text("Zoom: " + value, 10, display.height - 10);
			display.fill(Color.BLACK);
		}
	}

	public void setVisible(boolean visible)
	{
		this.visible = visible;
	}
}
